package reliability.types.graph;

import java.util.Map;
import java.util.TreeMap;

public class Edges
    extends TreeMap<Integer, Edge>
{
    public Integer findEdgeKey(Integer nodeKey)
    {
        for (Map.Entry<Integer, Edge> entry : entrySet())
        {
            Integer key = entry.getKey();
            Edge edge = entry.getValue();
            if (nodeKey.equals(edge.getNode1Key()) || nodeKey.equals(edge.getNode2Key()))
            {
                return key;
            }
        }
        return null;
    }
}
